package edu.tjhsst.androidIntranet;

import edu.tjhsst.androidIntranet.login.IntranetLogin;
import android.app.ListActivity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

public class IntranetListActivity extends ListActivity {


	/**
	 * This class is for duplicating functionality of the IntranetActivity in an ListActivity
	 */
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.intranet_menu, menu);
		return true;
	}

	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case R.id.settings_menu_item:
			startActivity(new Intent(this, IntranetPreferenceActivity.class));
			break;
		case R.id.logout_menu_item:
			startActivity(new Intent(this, IntranetLogin.class));
			break;
		}
		return true;
	}

}
